/**
 * @file lv_watch_common.h
 *
 */

#ifndef LV_WATCH_COMMON_H
#define LV_WATCH_COMMON_H

#ifdef __cplusplus
extern "C" {
#endif

/*********************
 *      INCLUDES
 *********************/
#ifdef LV_CONF_INCLUDE_SIMPLE
#include "lvgl.h"
#include "lv_watch_conf.h"
#else
#include "../../../lvgl/lvgl.h"
#include "../../../lv_watch_conf.h"
#endif

#if USE_LV_WATCH_COMMON != 0

/*********************
 *      DEFINES
 *
 ********************/

/**********************
 *      TYPEDEFS
 **********************/
#if LV_USE_ANIMATION
#  ifndef LV_WATCH_ANIM_TIME
#    define LV_WATCH_ANIM_TIME  300 /*Animation time of focusing to the a list element [ms] (0: no animation)  */
#  endif
#else
#  undef  LV_WATCH_ANIM_TIME
#  define LV_WATCH_ANIM_TIME  0   /*No animations*/
#endif

/**********************
 * GLOBAL PROTOTYPES
 **********************/
const void * lang_get_text_by_id(uint16_t txtId);
void lv_obj_set_y_animation(lv_obj_t * obj, lv_coord_t y, bool anim_en, uint16_t anim_time, void (*cb)(lv_anim_t *));
void lv_obj_set_x_animation(lv_obj_t * obj, lv_coord_t x, bool anim_en, uint16_t anim_time, void (*cb)(lv_anim_t *));
lv_obj_t * lv_watch_cont_create(lv_obj_t * par, lv_align_t cont_layout, lv_style_t * style, lv_coord_t width);
void btn_event_cb(lv_obj_t * obj, lv_event_t e);
uint32_t lv_watch_time_elaps(uint32_t last_tick, char * str, int8_t size);
void lv_watch_png_cache_all_free(void);
void lv_watch_get_child_obj(lv_obj_t * par, lv_signal_cb_t child_signal_func, lv_obj_t ** child_obj);
void lv_watch_get_parent_obj(lv_obj_t * element, lv_signal_cb_t par_signal_func, lv_obj_t ** par_obj);
bool lv_watch_is_activity_one_level(void);
void lv_watch_go_home(void);
void lv_watch_go_back(void);
void lv_watch_assert(void);
void lv_watch_set_free_num(lv_obj_t *obj, uint32_t num);
void lv_watch_set_free_ptr(lv_obj_t *obj, void *ptr);
void lv_watch_set_client_ptr(lv_obj_t *obj, void *ptr);
uint32_t lv_watch_get_free_num(lv_obj_t *obj);
void * lv_watch_get_free_ptr(lv_obj_t *obj);
void lv_watch_roller_set_sel_style(lv_obj_t *roller, char * str);
void lv_watch_img_common_signal(lv_obj_t * img, lv_signal_t sign, void * param);
void lv_watch_indev_reset(void);
void lv_watch_indev_set_draged(lv_obj_t * obj);
void lv_watch_set_wallpaper(lv_obj_t * obj);

/**********************
 *      MACROS
 **********************/

#endif /*USE_LV_WATCH_COMMON*/

#ifdef __cplusplus
} /* extern "C" */
#endif

#endif /*LV_WATCH_COMMON_H*/
